<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>flex布局</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        #container {
            display: flex;
            /* flex-direction 设置项目在父容器中的排列方式 */
            /* flex-direction: column; */
            /* flex-direction: column-reverse; */
            flex-direction: row;
            flex-wrap: wrap;
        }

        .item {
            text-align: center;
            padding: 1rem;
            background-color: #f4f4f4;
            border: 1px solid #ccc;
            flex: 1;
            margin: 0.75rem;
            /* color: #333;
           
            width: 400px; */
        }

        .item-1 {
            /* flex: 3; */
        }
    </style>
</head>

<body>
    <div id="container">
        <div class="item item-1">
            <h1>item-1</h1>
        </div>
        <div class="item item-2">
            <h1>item-2</h1>
        </div>
        <div class="item item-3">
            <h1>item-3</h1>
        </div>
        <div class="item item-4">
            <h1>item-4</h1>
        </div>
        <div class="item item-5">
            <h1>item-5</h1>
        </div>
        <div class="item item-6">
            <h1>item-6</h1>
        </div>
        <div class="item item-7">
            <h1>item-7</h1>
        </div>
        <div class="item item-8">
            <h1>item-8</h1>
        </div>
        <div class="item item-9">
            <h1>item-9</h1>
        </div>
        <div class="item item-10">
            <h1>item-10</h1>
        </div>
        <!--  <div class="item item-11">
           <h1>item-11</h1>
       </div>
       <div class="item item-12">
           <h1>item-12</h1>
       </div>
       <div class="item item-13">
           <h1>item-13</h1>
       </div>
       <div class="item item-14">
           <h1>item-14</h1>
       </div>
       <div class="item item-15">
           <h1>item-15</h1>
       </div>
       <div class="item item-16">
           <h1>item-16</h1>
       </div>
       <div class="item item-17">
           <h1>item-17</h1>
       </div>
       <div class="item item-18">
           <h1>item-18</h1>
       </div>
       <div class="item item-19">
           <h1>item-19</h1>
       </div>
       <div class="item item-20">
           <h1>item-20</h1>
       </div> -->
    </div>
</body>

</html>